package com.leyou.trade.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leyou.trade.entity.OrderDetail;
import com.leyou.trade.mapper.OrderDetailMapper;
import com.leyou.trade.service.OrderDetailService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;


@Service
public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailMapper, OrderDetail> implements OrderDetailService {
    @Override
    public List<Long> listSkuIdsByOrderId(Long orderId) {
        List<OrderDetail> orderDetails = query().eq("order_id", orderId).list();
        return orderDetails.stream().map(OrderDetail::getSkuId).collect(Collectors.toList());
    }
}